<template>
  <div>
      <h5>小U商城后台</h5>
      <!-- router: 开启路由模式 启用该模式会在激活导航时以 index 作为 path 进行路由跳转 -->
      <!-- default-active: 默认展开的index那一项 $route.path 为当前路由地址 -->
    <el-menu
      router 
      :default-active="$route.path"
      class="el-menu-vertical-demo"
      @open="Open"
      @close="Close"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      <el-menu-item index="/">
        <i class="el-icon-setting"></i>
        <span slot="title" @click="get">首页</span>
      </el-menu-item>
      <el-submenu index="1">
        <template slot="title">
          <i class="el-icon-setting"></i>
          <span>系统设置</span>
        </template>
        <el-menu-item-group >
          <el-menu-item index="/menu">菜单管理</el-menu-item>
          <el-menu-item index="/role">角色管理</el-menu-item>
          <el-menu-item index="/admin">管理员管理</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-s-goods"></i>
          <span>商城管理</span>
        </template>
        <el-menu-item-group >
          <el-menu-item index="">商品分类</el-menu-item>
          <el-menu-item index="">商品规格</el-menu-item>
          <el-menu-item index="">商品管理</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
     
    </el-menu>
  </div>
</template>

<script>


import { mapState, mapGetters} from 'vuex';


export default {
    data(){
      return {

      }
    },
     computed: {
      ...mapState(["menulist"]),
      ...mapGetters(["myList",'menuData']),
    },
     methods: {
      Open(key, keyPath) {
        // console.log(key, keyPath);
      },
      Close(key, keyPath) {
        // console.log(key, keyPath);
      },
      get(){
        console.log(this.menuData);
      }
    },
   
}
</script>

<style>

</style>